const parameter = getApp().globalData.parameter
const domainName = getApp().globalData.domainName
const oss_domain = getApp().globalData.oss_domain

// pages/gs/video_library/video_library.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    icon_url:oss_domain+'static/picture/app_icon/',
    windowWidth:wx.getSystemInfoSync().windowWidth,
    loading:true,
    lis:[],
  },

  watch_video(e){
    getApp().get_vibration()
    let index = e.currentTarget.id
    wx.navigateTo({
      url: '/pages/video/video_play/video_play?video_info=' + encodeURIComponent(JSON.stringify(this.data.lis[index])),
    })
  },

  page_init(){
    wx.request({
      url: domainName + '/video_library_init',
      data: {},...parameter,
      success: res => {
        this.setData({
          lis:res.data.lis,
          loading:false
        })
      },
    })
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.page_init()
  },

})